<?php
class url extends url_Core
{
	public static function prev()
	{
		$prev_url = Session::instance()->get_once('prev_url');
		$referer = parse_url(request::referrer());
		$return_url = '';
		if(!empty($referer['query']))
		{
			$return_url = $referer['query'];
		}
		if(strstr($return_url,'return_url')!==false)
		{
			$prev_url = end(explode('=',$return_url));
		}
		if($prev_url)
		{
			url::redirect($prev_url);
			exit;
		}
		url::redirect();
	}
}
